const express = require('express');
const router = express.Router();
const reviewController = require('../controllers/reviewController');
const { authenticate } = require('../middleware/auth');
const upload = require('../middleware/upload');

router.post('/', authenticate, upload.array('images', 3), reviewController.addReview);
router.get('/product/:product_id', reviewController.getProductReviews);
router.get('/user', authenticate, reviewController.getUserReviews);
router.delete('/:id', authenticate, reviewController.deleteReview);

module.exports = router;